package com.recruit.common.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.recruit.common.model.ApplicationDO;
import com.recruit.common.model.result.ApplicationResultDO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author Eval
 * @since 2022-04-04
 */
@Mapper
public interface ApplicationMapper extends BaseMapper<ApplicationDO> {

    IPage<ApplicationResultDO> getByHrId(Page<ApplicationResultDO> page, @Param("hrID") Integer hrID, @Param("state") Integer state);

    IPage<ApplicationResultDO> getByHrIdAndResume(Page<ApplicationResultDO> page, @Param("hrID") Integer hrID, @Param("state") Integer state);

    IPage<ApplicationResultDO> getByHrId2(Page<ApplicationResultDO> page, @Param("hrID") Integer hrID, @Param("state") Integer state, @Param("state2") Integer state2);

    boolean updateState(@Param("id") Integer id, @Param("state") Integer state);

    IPage<ApplicationResultDO> sortByGrade(Page<ApplicationResultDO> page, @Param("hrID") Integer hrID);

    IPage<ApplicationResultDO> getByUserId(Page<ApplicationResultDO> page, @Param("userId") Integer userId);

}
